home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / cpp_libs / intrvews / tut-code.lha / tut-code / button3 / main.c < prev   
Encoding:
C/C++ Source or Header  |  1992-01-02  |  1.2 KB  |  64 lines

  1. #include <IV-look/kit.h>
  2. #include <InterViews/background.h>
  3. #include <InterViews/box.h>
  4. #include <InterViews/glue.h>
  5. #include <InterViews/place.h>
  6. #include <InterViews/session.h>
  7. #include <InterViews/style.h>
  8. #include <InterViews/window.h>
  9. #include <stdio.h>
  10.  
  11. class App {
  12. public:
  13.     void msg();
  14. };
  15.  
  16. declare(ActionCallback,App)
  17. implement(ActionCallback,App)
  18.  
  19. void App::msg() {
  20.     printf("hi mom!\n");
  21. }
  22.  
  23. int main(int argc, char** argv) {
  24.     Session* session = new Session("Himom", argc, argv);
  25.     Style* style = session->style();
  26.     Kit* kit = Kit::instance();
  27.     App* a = new App;
  28.     TelltaleGroup* group = new TelltaleGroup;
  29.     session->run_window(
  30.     new ApplicationWindow(
  31.         new Background(
  32.         new Margin(
  33.             new LRBox(
  34.             new VCenter(
  35.                 kit->simple_toggle_button(
  36.                 "Toggle me", style,
  37.                 new ActionCallback(App)(a, &App::msg)
  38.                 ),
  39.                 0.5
  40.             ),
  41.             new HGlue(15.0),
  42.             new VCenter(
  43.                 new TBBox(
  44.                 new VCenter(
  45.                     kit->simple_radio_button(
  46.                     group, "One", style, nil
  47.                     ),
  48.                     1.0
  49.                 ),
  50.                 kit->simple_radio_button(
  51.                     group, "Two", style, nil
  52.                 )
  53.                 ),
  54.                 0.5
  55.             )
  56.             ),
  57.             10.0
  58.         ),
  59.         style->flat()
  60.         )
  61.     )
  62.     );
  63. }
  64.